package com.yuwei.module_device.model

import com.bw.lib_common.entity.Res
import com.bw.lib_common.model.BaseRepository
import com.bw.lib_http.OkHttpClientManager
import com.yuwei.common.entity.DeviceEntity
import com.yuwei.common.entity.DeviceEntityItem
import com.yuwei.module_device.api.DeviceApiService

class DeviceRepository:BaseRepository<DeviceApiService>() {
    override fun createApiServer(): DeviceApiService =  OkHttpClientManager.retrofitInstance.create(
        DeviceApiService::class.java)
    suspend fun getDeviceList():Res<DeviceEntity> = apiService.getDevice()

    suspend fun addDevice(deviceEntityItem: DeviceEntityItem):Res<DeviceEntityItem>{
        return apiService.addDevice(deviceEntityItem)
    }
}